package com.zsm.eblog.mapper;

import com.zsm.eblog.pojo.Article;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * Author : ZSM
 * Time :  2024/08/17
 */
@Mapper
public interface ArticleMapper {

    @Select("""
            select * from articles where delete_flag = 0 and type = #{type};
           """)
    List<Article> list(String type);

    @Select("""
            select * from articles where delete_flag = 0 and id = #{id};
            """)
    Article queryById(Integer id);
}
